<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>{:$page_info['title']}</title>
<link rel="icon" href="favicon.ico" type="__STATIC__/admin/image/ico">

<meta name="author" content="yinqi">
<link href="__STATIC__/admin/css/bootstrap.min.css" rel="stylesheet">
<link href="__STATIC__/admin/css/materialdesignicons.min.css" rel="stylesheet">
<!--标签插件-->
<link rel="stylesheet" href="__STATIC__/admin/js/jquery-tags-input/jquery.tagsinput.min.css">
<link href="__STATIC__/admin/css/style.min.css" rel="stylesheet">

<link href="__STATIC__/common/select2/select2.css" rel="stylesheet">
<link href="__STATIC__/admin/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet">

<link href="__STATIC__/common/webuploader/webuploader.css" rel="stylesheet">

<link href="__STATIC__/admin/css/cch.css" rel="stylesheet">
</head>
  
<body>
<div class="container-fluid p-t-15">
  
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">
          
          <form action="" method="post" class="row">
            <?php foreach ($fields as $field => $vo): ?>
                <?php $value = emptyDef($vo['value'],$data[$field],'isset'); ?>
                <?php if ($vo['type'] == 'text'): ?>
                <div class="form-group col-md-12">
                    <label for="{:$field}">{:$vo['name']} {:in_array('required',$vo['valids'])?'<span class="text-orange">*</span>':''}</label>
                    <input class="form-control" type="text" id="{:$field}" name="{:$field}" placeholder="{:$vo['placeholder']}" value="{:$value}" />
                </div>
                <?php elseif ($vo['type'] == 'textarea'): ?>
                <div class="form-group col-md-12">
                    <label for="{:$field}">{:$vo['name']} {:in_array('required',$vo['valids'])?'<span class="text-orange">*</span>':''}</label>
                    <textarea class="form-control" id="{:$field}" name="{:$field}" rows="4" placeholder="{:$vo['placeholder']}">{:$value}</textarea>
                </div> 
                <?php elseif ($vo['type'] == 'file'): ?>
                <div class="form-group col-md-12">
                    
                    <label class="col-lg-1 control-label">{:$vo['name']}</label>
                    <div class="col-md-6">
                        <div id="{:$field}" class="uploader_btn">选择文件</div>
                        <span class="uploader_span"></span>
                        <input class="form-control" type="hidden" name="{:$field}" value="{:$value}" />
                        <img src="__UPLOAD__/{:$value}" class="cch_thumbnail">
                    </div>
                    
                </div>


                <?php endif ?>
            <?php endforeach ?>


            <div class="form-group col-md-12">
              <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
              <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
          </form>
 
        </div>
      </div>
    </div>
    
  </div>
  
</div>

<script type="text/javascript" src="__STATIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/bootstrap.min.js"></script>
<!--标签插件-->
<script src="__STATIC__/admin/js/jquery-tags-input/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/main.min.js"></script>

<!-- 时间选择器 -->
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>

<script src="__STATIC__/common/select2/select2.min.js"></script><!-- 下拉搜索 -->

<script src="__STATIC__/common/webuploader/webuploader.js"></script><!-- 上传 -->

<script type="text/javascript" src="__STATIC__/admin/js/lyear-loading.js"></script><!-- loading -->
<script type="text/javascript" src="__STATIC__/admin/js/cch.js"></script>
<script type="text/javascript">
  var static_path = '__STATIC__';
  var upload_path = '__UPLOAD__';
  var upload_api_server = '{:url('base/upload')}';
  var upload_type = 'admin';
</script>
</body>
</html>